package com.playmodule.vr.projections;

public class CubeProjection
  extends Projection
{
  static final int SIDES = 6;
  
  public CubeProjection(int paramInt)
  {
    setupProjection(paramInt);
  }
  
  private float[] genUVs(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, float paramFloat7)
  {
    float f1 = (paramFloat1 + 1.0F) / 2.0F;
    float f2 = (paramFloat2 + 1.0F) / 2.0F;
    float f3 = (paramFloat3 + 1.0F) / 2.0F;
    float f4 = (paramFloat4 + 1.0F) / 2.0F;
    float f5 = (1.0F + -paramFloat5) / 2.0F;
    float f6 = (1.0F + -paramFloat6) / 2.0F;
    float f7 = (1.0F + -paramFloat7) / 2.0F;
    return new float[] { f3, f5, f2, f5, f2, f6, f3, f6, f3, f6, f2, f6, f2, f7, f3, f7, f2, f6, f1, f6, f1, f7, f2, f7, f1, f5, f1, f6, f2, f6, f2, f5, f3, f6, f3, f7, f4, f7, f4, f6, f3, f5, f3, f6, f4, f6, f4, f5 };
  }
  
  private float[] genVertices(float paramFloat1, float paramFloat2)
  {
    float[] arrayOfFloat = new float[72];
    arrayOfFloat[0] = (paramFloat2 + paramFloat1);
    arrayOfFloat[1] = (-paramFloat1);
    arrayOfFloat[2] = paramFloat1;
    arrayOfFloat[3] = (paramFloat2 - paramFloat1);
    arrayOfFloat[4] = (-paramFloat1);
    arrayOfFloat[5] = paramFloat1;
    arrayOfFloat[6] = (paramFloat2 - paramFloat1);
    arrayOfFloat[7] = (-paramFloat1);
    arrayOfFloat[8] = (-paramFloat1);
    arrayOfFloat[9] = (paramFloat2 + paramFloat1);
    arrayOfFloat[10] = (-paramFloat1);
    arrayOfFloat[11] = (-paramFloat1);
    arrayOfFloat[12] = (paramFloat2 + paramFloat1);
    arrayOfFloat[13] = (-paramFloat1);
    arrayOfFloat[14] = (-paramFloat1);
    arrayOfFloat[15] = (paramFloat2 - paramFloat1);
    arrayOfFloat[16] = (-paramFloat1);
    arrayOfFloat[17] = (-paramFloat1);
    arrayOfFloat[18] = (paramFloat2 - paramFloat1);
    arrayOfFloat[19] = paramFloat1;
    arrayOfFloat[20] = (-paramFloat1);
    arrayOfFloat[21] = (paramFloat2 + paramFloat1);
    arrayOfFloat[22] = paramFloat1;
    arrayOfFloat[23] = (-paramFloat1);
    arrayOfFloat[24] = (paramFloat2 - paramFloat1);
    arrayOfFloat[25] = (-paramFloat1);
    arrayOfFloat[26] = (-paramFloat1);
    arrayOfFloat[27] = (paramFloat2 - paramFloat1);
    arrayOfFloat[28] = (-paramFloat1);
    arrayOfFloat[29] = paramFloat1;
    arrayOfFloat[30] = (paramFloat2 - paramFloat1);
    arrayOfFloat[31] = paramFloat1;
    arrayOfFloat[32] = paramFloat1;
    arrayOfFloat[33] = (paramFloat2 - paramFloat1);
    arrayOfFloat[34] = paramFloat1;
    arrayOfFloat[35] = (-paramFloat1);
    arrayOfFloat[36] = (paramFloat2 - paramFloat1);
    arrayOfFloat[37] = paramFloat1;
    arrayOfFloat[38] = (-paramFloat1);
    arrayOfFloat[39] = (paramFloat2 - paramFloat1);
    arrayOfFloat[40] = paramFloat1;
    arrayOfFloat[41] = paramFloat1;
    arrayOfFloat[42] = (paramFloat2 + paramFloat1);
    arrayOfFloat[43] = paramFloat1;
    arrayOfFloat[44] = paramFloat1;
    arrayOfFloat[45] = (paramFloat2 + paramFloat1);
    arrayOfFloat[46] = paramFloat1;
    arrayOfFloat[47] = (-paramFloat1);
    arrayOfFloat[48] = (paramFloat2 + paramFloat1);
    arrayOfFloat[49] = (-paramFloat1);
    arrayOfFloat[50] = (-paramFloat1);
    arrayOfFloat[51] = (paramFloat2 + paramFloat1);
    arrayOfFloat[52] = paramFloat1;
    arrayOfFloat[53] = (-paramFloat1);
    arrayOfFloat[54] = (paramFloat2 + paramFloat1);
    arrayOfFloat[55] = paramFloat1;
    arrayOfFloat[56] = paramFloat1;
    arrayOfFloat[57] = (paramFloat2 + paramFloat1);
    arrayOfFloat[58] = (-paramFloat1);
    arrayOfFloat[59] = paramFloat1;
    arrayOfFloat[60] = (paramFloat2 + paramFloat1);
    arrayOfFloat[61] = (-paramFloat1);
    arrayOfFloat[62] = paramFloat1;
    arrayOfFloat[63] = (paramFloat2 + paramFloat1);
    arrayOfFloat[64] = paramFloat1;
    arrayOfFloat[65] = paramFloat1;
    arrayOfFloat[66] = (paramFloat2 - paramFloat1);
    arrayOfFloat[67] = paramFloat1;
    arrayOfFloat[68] = paramFloat1;
    arrayOfFloat[69] = (paramFloat2 - paramFloat1);
    arrayOfFloat[70] = (-paramFloat1);
    arrayOfFloat[71] = paramFloat1;
    return arrayOfFloat;
  }
  
  private float[] genVerticesStereo(float paramFloat)
  {
    return concat(genVertices(4.0F, 65536.0F), genVertices(4.0F, -65536.0F));
  }
  
  float[] concat(float[] paramArrayOfFloat1, float[] paramArrayOfFloat2)
  {
    int i = paramArrayOfFloat1.length;
    int j = paramArrayOfFloat2.length;
    float[] arrayOfFloat = new float[i + j];
    System.arraycopy(paramArrayOfFloat1, 0, arrayOfFloat, 0, i);
    System.arraycopy(paramArrayOfFloat2, 0, arrayOfFloat, i, j);
    return arrayOfFloat;
  }
  
  protected void generateMono()
  {
    float[] arrayOfFloat1 = genVertices(4.0F, 0.0F);
    short[] arrayOfShort = new short[36];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    arrayOfShort[12] = 8;
    arrayOfShort[13] = 9;
    arrayOfShort[14] = 10;
    arrayOfShort[15] = 10;
    arrayOfShort[16] = 11;
    arrayOfShort[17] = 8;
    arrayOfShort[18] = 12;
    arrayOfShort[19] = 13;
    arrayOfShort[20] = 14;
    arrayOfShort[21] = 14;
    arrayOfShort[22] = 15;
    arrayOfShort[23] = 12;
    arrayOfShort[24] = 16;
    arrayOfShort[25] = 17;
    arrayOfShort[26] = 18;
    arrayOfShort[27] = 18;
    arrayOfShort[28] = 19;
    arrayOfShort[29] = 16;
    arrayOfShort[30] = 20;
    arrayOfShort[31] = 21;
    arrayOfShort[32] = 22;
    arrayOfShort[33] = 22;
    arrayOfShort[34] = 23;
    arrayOfShort[35] = 20;
    float[] arrayOfFloat2 = genUVs(-1.0F, -0.33F, 0.33F, 1.0F, 1.0F, 0.0F, -1.0F);
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  protected void generateOverUnder()
  {
    float[] arrayOfFloat1 = genVerticesStereo(4.0F);
    short[] arrayOfShort = new short[72];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    arrayOfShort[12] = 8;
    arrayOfShort[13] = 9;
    arrayOfShort[14] = 10;
    arrayOfShort[15] = 10;
    arrayOfShort[16] = 11;
    arrayOfShort[17] = 8;
    arrayOfShort[18] = 12;
    arrayOfShort[19] = 13;
    arrayOfShort[20] = 14;
    arrayOfShort[21] = 14;
    arrayOfShort[22] = 15;
    arrayOfShort[23] = 12;
    arrayOfShort[24] = 16;
    arrayOfShort[25] = 17;
    arrayOfShort[26] = 18;
    arrayOfShort[27] = 18;
    arrayOfShort[28] = 19;
    arrayOfShort[29] = 16;
    arrayOfShort[30] = 20;
    arrayOfShort[31] = 21;
    arrayOfShort[32] = 22;
    arrayOfShort[33] = 22;
    arrayOfShort[34] = 23;
    arrayOfShort[35] = 20;
    arrayOfShort[36] = 24;
    arrayOfShort[37] = 25;
    arrayOfShort[38] = 26;
    arrayOfShort[39] = 26;
    arrayOfShort[40] = 27;
    arrayOfShort[41] = 24;
    arrayOfShort[42] = 28;
    arrayOfShort[43] = 29;
    arrayOfShort[44] = 30;
    arrayOfShort[45] = 30;
    arrayOfShort[46] = 31;
    arrayOfShort[47] = 28;
    arrayOfShort[48] = 32;
    arrayOfShort[49] = 33;
    arrayOfShort[50] = 34;
    arrayOfShort[51] = 34;
    arrayOfShort[52] = 35;
    arrayOfShort[53] = 32;
    arrayOfShort[54] = 36;
    arrayOfShort[55] = 37;
    arrayOfShort[56] = 38;
    arrayOfShort[57] = 38;
    arrayOfShort[58] = 39;
    arrayOfShort[59] = 36;
    arrayOfShort[60] = 40;
    arrayOfShort[61] = 41;
    arrayOfShort[62] = 42;
    arrayOfShort[63] = 42;
    arrayOfShort[64] = 43;
    arrayOfShort[65] = 40;
    arrayOfShort[66] = 44;
    arrayOfShort[67] = 45;
    arrayOfShort[68] = 46;
    arrayOfShort[69] = 46;
    arrayOfShort[70] = 47;
    arrayOfShort[71] = 44;
    float[] arrayOfFloat2 = concat(genUVs(-1.0F, -0.33F, 0.33F, 1.0F, 0.0F, -0.5F, -1.0F), genUVs(-1.0F, -0.33F, 0.33F, 1.0F, 1.0F, 0.5F, 0.0F));
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  protected void generateSideBySide()
  {
    float[] arrayOfFloat1 = genVerticesStereo(4.0F);
    short[] arrayOfShort = new short[72];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    arrayOfShort[12] = 8;
    arrayOfShort[13] = 9;
    arrayOfShort[14] = 10;
    arrayOfShort[15] = 10;
    arrayOfShort[16] = 11;
    arrayOfShort[17] = 8;
    arrayOfShort[18] = 12;
    arrayOfShort[19] = 13;
    arrayOfShort[20] = 14;
    arrayOfShort[21] = 14;
    arrayOfShort[22] = 15;
    arrayOfShort[23] = 12;
    arrayOfShort[24] = 16;
    arrayOfShort[25] = 17;
    arrayOfShort[26] = 18;
    arrayOfShort[27] = 18;
    arrayOfShort[28] = 19;
    arrayOfShort[29] = 16;
    arrayOfShort[30] = 20;
    arrayOfShort[31] = 21;
    arrayOfShort[32] = 22;
    arrayOfShort[33] = 22;
    arrayOfShort[34] = 23;
    arrayOfShort[35] = 20;
    arrayOfShort[36] = 24;
    arrayOfShort[37] = 25;
    arrayOfShort[38] = 26;
    arrayOfShort[39] = 26;
    arrayOfShort[40] = 27;
    arrayOfShort[41] = 24;
    arrayOfShort[42] = 28;
    arrayOfShort[43] = 29;
    arrayOfShort[44] = 30;
    arrayOfShort[45] = 30;
    arrayOfShort[46] = 31;
    arrayOfShort[47] = 28;
    arrayOfShort[48] = 32;
    arrayOfShort[49] = 33;
    arrayOfShort[50] = 34;
    arrayOfShort[51] = 34;
    arrayOfShort[52] = 35;
    arrayOfShort[53] = 32;
    arrayOfShort[54] = 36;
    arrayOfShort[55] = 37;
    arrayOfShort[56] = 38;
    arrayOfShort[57] = 38;
    arrayOfShort[58] = 39;
    arrayOfShort[59] = 36;
    arrayOfShort[60] = 40;
    arrayOfShort[61] = 41;
    arrayOfShort[62] = 42;
    arrayOfShort[63] = 42;
    arrayOfShort[64] = 43;
    arrayOfShort[65] = 40;
    arrayOfShort[66] = 44;
    arrayOfShort[67] = 45;
    arrayOfShort[68] = 46;
    arrayOfShort[69] = 46;
    arrayOfShort[70] = 47;
    arrayOfShort[71] = 44;
    float[] arrayOfFloat2 = concat(genUVs(-1.0F, -0.66F, -0.33F, 0.0F, 1.0F, 0.0F, -1.0F), genUVs(0.0F, 0.33F, 0.66F, 1.0F, 1.0F, 0.0F, -1.0F));
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
}